based on:
M. Hiabu, J. T. Meyer, M. N. Wright. Unifying local and global model explanations by functional decomposition of low dimensional structures. AISTATS 2023.
Both accepted at International Conference on Artificial Intelligence and Statistics (AISTATS) 2023.
Consider the function \[m(x_1, x_2) = x_1 + x_2 + 2x_1x_2,\] where \(\mathbb{E}X_1 = \mathbb{E}X_2 = 0\) and \(\mathbb{Var}X_1 = \mathbb{Var}X_2 = 1\).
It can be shown that SHAP value for the first feature is \[\phi_1(x_1, x_2) = x_1 - \mathbb{E}[X_1] + x_1x_2 - \mathbb{E}[X_1X_2] + x_1\mathbb{E}[X_2] - x_2\mathbb{E}[X_1] = x_1 + x_1 x_2 - \mathrm{corr}(X_1, X_2).\]
If \(\mathrm{corr}(X_1, X_2) = 0.3\), then for observation with \((x_1, x_2) = (1, -0.7)\), SHAP value for the first feature is \(\phi_1(1, -0.7) = 0\).
WHY? The main effect contribution and interaction contribution cancel each other out.
WHAT TO DO? Decompose SHAP value \(\phi_1\) into main and interaction contributions.
SHAP values and functional decomposition for XGBoost model of \(m(x_1, x_2)\) function.
glex R package).What can be done with this new explanation method?
Without identification constraints, it has many solutions.
Added constraints – called marginal identification: \[ \forall S \subseteq [d] \quad\; \sum_{T \cap S \neq \emptyset} \mathbb{E}_{X_{S}}[\widehat{m}_T(x_T)] = 0 \]
More intuitively, it is equivalent to: \[ \forall S \subseteq [d] \quad\; \sum_{T} \mathbb{E}_{X_{S}}[\widehat{m}_T(x_T)] = \sum_{T \cap S = \emptyset} \widehat{m}_T(x_T)\]
(Some math skipped here.)
Interventional SHAP values are obtained via the well-known Shapley formula from the value function: \[v(x^*, S) = \mathbb{E}_{X_{-S}} [\widehat{m}(x_{S}, x_{-S}) | X_S = x^{*}_S].\]
The interventional SHAP values are weighted averages of the corresponding components from proposed functional decomposition. (Note: Local SHAP values can be described by the components of global explanation!)
The relation is quite simple: \[\phi_k(x) = \widehat{m}_k(x_k) + \frac12 \sum_j \widehat{m}_{k,j}(x_k, x_j) + \ldots + \frac1d \widehat{m}_{1,\ldots,d}(x).\]
Partial Dependence Plots can be described in terms of proposed global explanation: \[\begin{align*} PDP_S(x_S) &= \mathbb{E}_{X_{-S}}[\widehat{m}(x)|X_S=x_S] \\ &= \sum_{U \subseteq S} \widehat{m}_U(x_U). \end{align*}\]
For one-dimensional case: \[ PDP_k(x_k) = \widehat{m}_0 + \widehat{m}_k(x_k).\]
Proposed global explanation allows for de-biasing via post-hoc feature removal.
If \(U\) is the set of protected features and \(V = [d] \setminus U\), de-biased version of model is: \[ \widetilde{m}(x_{-U}) = \sum_{S \subseteq V} \widehat{m}_S(x_S).\]
In feature importance calculated based on SHAP values, contributions from interactions and main effects can cancel each other out.
Having functional decomposition, we can consider:
Also for the function \(m(x) = x_1 + x_3 + x_2x_3 - 2 x_2 x_3 x_4\).
Mateusz Krzyziński – Shapley values and functional decompositions